import z from "zod";
import i18n from "@/i18n";

export const UpdateMobileSchema = () =>
  z.object({
    mobile: z
      .string()
      .regex(/^1[3-9]\d{9}$/, {
        message: i18n.t("Invalid mobile number", { defaultValue: "Invalid mobile number" }),
      })
      .min(1, {
        message: i18n.t("Mobile number is required", {
          defaultValue: "Mobile number is required",
        }),
      }),
    captcha: z.string().min(1, {
      message: i18n.t("Captcha is required", {
        defaultValue: "Captcha is required",
      }),
    }),
  });

export type UpdateMobileFormData = z.infer<ReturnType<typeof UpdateMobileSchema>>;
